package com.yyfax.pay.third.model.to.fuiou;

import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.io.xml.QNameMap;
import com.thoughtworks.xstream.io.xml.StaxDriver;

import java.io.Serializable;

@XStreamAlias("RESPONSE")
public class FuiouProtocolPayRsp implements Serializable {

    @XStreamAlias("VERSION")
    private String version;

    @XStreamAlias("TYPE")
    private String type;

    @XStreamAlias("RESPONSECODE")
    private String respCode;

    @XStreamAlias("RESPONSEMSG")
    private String respDesc;

    @XStreamAlias("MCHNTCD")
    private String merchantCode;

    @XStreamAlias("USERID")
    private String userId;

    @XStreamAlias("MCHNTORDERID")
    private String merchantOrderId;

    @XStreamAlias("ORDERID")
    private String thirdOrderId;

    @XStreamAlias("PROTOCOLNO")
    private String protocolCode;

    @XStreamAlias("BANKCARD")
    private String cardNo;

    @XStreamAlias("AMT")
    private String amt;

    @XStreamAlias("SIGNTP")
    private String signType;

    @XStreamAlias("SIGN")
    private String sign;

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    public String getSignType() {
        return signType;
    }

    public void setSignType(String signType) {
        this.signType = signType;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getRespCode() {
        return respCode;
    }

    public void setRespCode(String respCode) {
        this.respCode = respCode;
    }

    public String getRespDesc() {
        return respDesc;
    }

    public void setRespDesc(String respDesc) {
        this.respDesc = respDesc;
    }

    public String getMerchantCode() {
        return merchantCode;
    }

    public void setMerchantCode(String merchantCode) {
        this.merchantCode = merchantCode;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getMerchantOrderId() {
        return merchantOrderId;
    }

    public void setMerchantOrderId(String merchantOrderId) {
        this.merchantOrderId = merchantOrderId;
    }

    public String getThirdOrderId() {
        return thirdOrderId;
    }

    public void setThirdOrderId(String thirdOrderId) {
        this.thirdOrderId = thirdOrderId;
    }

    public String getProtocolCode() {
        return protocolCode;
    }

    public void setProtocolCode(String protocolCode) {
        this.protocolCode = protocolCode;
    }

    public String getCardNo() {
        return cardNo;
    }

    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }

    public String getAmt() {
        return amt;
    }

    public void setAmt(String amt) {
        this.amt = amt;
    }

    public static FuiouProtocolPayRsp fromXml(String xml) {
        QNameMap qmap = new QNameMap();
        qmap.setDefaultPrefix("");
        StaxDriver staxDriver = new StaxDriver(qmap);
        XStream xstream = new XStream(staxDriver);
        xstream.autodetectAnnotations(true);
        xstream.ignoreUnknownElements();
        xstream.alias("RESPONSE", FuiouProtocolPayRsp.class);
        return (FuiouProtocolPayRsp) xstream.fromXML(xml);
    }
}
